﻿<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common/meta.jsp"%>
<%@ include file="/common/content.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>新闻信息管理</title>
		
<script type="text/javascript">
	$(document).ready(function(){
		
		$("#alllist").click(
			function(){
				if($(this).attr("checked")){
					$(this).attr("checked",true);
					$(".list").attr("checked",true);
				}else{
					$(this).attr("checked",false);
					$(".list").attr("checked",false);
				}
			}
		);
	});
	
	function submitForm(message,flag){
		if(confirm(message)){
			if(flag==1){
				$("#flag").attr("value","true");
			}else{
				$("#flag").attr("value","false");
			}
			$("#enterpriseList").submit();
			return true;
		}
		return false;
	}
</script>
	</head>
	<body>
		<div class="rhead">
			<div class="rpos">当前位置: 内容管理 - <c:if test="${empty column.names}">总站</c:if>${column.names}</div>
			<div class="ropt">
					<c:if test="${not empty column.names}">
						<input type="button" value=" 新增 " onclick="location.href='${ctx}/collection/epNewsAction!add_page.action?father=${column.id}'"/>
					</c:if>
			</div>
			<div class="clear"></div>
		</div>
		<form action="epNewsAction!queryByTitleAndState.action" method="post">
		<input type="hidden" name="father" value="<c:if test="${empty column.id}">0</c:if><c:if test="${not empty column.id}">${column.id}</c:if>" />
		<table class="listTable2">
			<tr>
				<td class="pn-flabel" style="text-align:left;padding-left:15px;">标题：<input type="text" name="title" value="${title}" />
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;状态：
					<select name="state">
						<option value="-1">全部</option>
						<option value="1" <c:if test="${state==1}">selected</c:if>>已通过</option>
						<option value="0" <c:if test="${state==0}">selected</c:if>>未通过</option>
						<option value="2" <c:if test="${state==2}">selected</c:if>>待审核</option>
					</select>
					<input type="submit" style="margin-left:30px;" class="default_button" value="查询"/>
				</td>
			</tr>
		</table>
		</form>
		<table class="listTable3" onmouseover="changeto()"
			onmouseout="changeback()">
			<tr class="headbg">
				<td width="400px;">
					标题
				</td>
				<td>
					编辑人
				</td>
				<td width="100px;">
					更新时间
				</td>
				<td width="60px;">
					新闻类型
				</td>
				<td>
					状态
				</td>
				<td>
					基本操作
				</td>
			</tr>
			<c:forEach var="news" items="${enterpriseNewsList}">
				<tr>
					<td>
						<font style="font-weight:bold;overflow:hidden;">[${news.enterpriseColumn.names}]</font>
						<c:choose>
	                          <c:when test="${fn:length(news.title)>25}">
	                                ${fn:substring(news.title,0,25)}...
	                          </c:when>
	                          <c:otherwise>
	                                ${news.title}
	                          </c:otherwise>
	                    </c:choose>
					</td>
					<td style="width:129px;text-align:center;">
						${news.users.workunit}
					</td>
					<td style="width:70px;text-align:center;">
						<fmt:formatDate value="${news.editeTime}" pattern="yyyy-MM-dd" />
					</td>
					<td style="width:70px;text-align:center;">
						<c:if test="${news.isPrimPhoto == '1'}">
							<font color="red">图片新闻</font>
						</c:if>
						<c:if test="${news.isPrimPhoto == '0'}">
							普通新闻
						</c:if>
						<c:if test="${news.isPrimPhoto == '2'}">
							<font color="blue">文件新闻</font>
						</c:if>
					</td>
					<td style="width:70px;text-align:center;">
						<c:if test="${news.state == 1}">已通过</c:if>
						<c:if test="${news.state == 0}"><font color="red">未通过</font></c:if>
						<c:if test="${news.state == 2}"><font color="blue">待审核</font></c:if>
					</td>
					<td style="text-align:center;">
						<a href="epNewsAction!view.action?id=${news.id}&father=${news.enterpriseColumn.id}"> 查看 </a>&nbsp;
						&nbsp;
						
						<c:if test="${news.enterpriseColumn.typeColumn!='content'}">
								<a href="epNewsAction!edit.action?id=${news.id}&father=${news.enterpriseColumn.id}"> 编辑 </a>&nbsp;
								&nbsp;
								<a href="epNewsAction!delete.action?id=${news.id}&father=${news.enterpriseColumn.id}"
									onclick="{if(confirm('你真的要删除吗?')){return true;}return false;}">
									删除 </a>
						</c:if>
					</td>
				</tr>
			</c:forEach>
		</table>
		
		<c:if test="${not empty enterpriseNewsList}">
		<s:form action="epNewsAction!query.action" method="post" name="form1" theme="simple">
			<input type="hidden" name="father" value="${father}"/>
			<input type="hidden" name="title" value="<c:if test="${not empty title}">${title}</c:if>" />
			<input type="hidden" name="state" value="<c:if test="${empty state}">-1</c:if><c:if test="${not empty state}">${state}</c:if>" />
			
			<table class="listTable2">
				<tr>
					<td width="50%">
						&nbsp;&nbsp;共有 <s:property value="pager.rowCount" /> 条记录，每页行数：
							<s:select name="pageSize" list="pager.pageSizeIndexs" 
								theme="simple"
								value="pager.pageSize"
								onchange="document.all.pageNo.value='1';document.all.form1.submit();" />当前第 
	            <s:select name="pageNo" list="pager.pageNoIndexs" theme="simple"
								value="pager.pageNo" onchange="document.all.form1.submit();" />
				 页
					</td>
					<td width="200px">
	                  <a
								href="javascript:document.all.pageNo.value='<s:property value="pager.firstPageNo" />';document.all.form1.submit();">
								<img src="${ctx}/image/jwc/first.gif" width="37" height="15" /></a>
	                 
	                  <a
								href="javascript:document.all.pageNo.value='<s:property value="pager.prePageNo" />';document.all.form1.submit();">
								<img src="${ctx}/image/jwc/back.gif" width="43" height="15" /></a>
	                
	                  <a
								href="javascript:document.all.pageNo.value='<s:property value="pager.nextPageNo"/>';document.all.form1.submit();">
								<img src="${ctx}/image/jwc/next.gif" width="43" height="15" /></a>
	                  
	                  <a
								href="javascript:document.all.pageNo.value='<s:property value="pager.lastPageNo" />';document.all.form1.submit();">
	                  <img src="${ctx}/image/jwc/last.gif" width="37" height="15" /></a>
	                  </td>
				</tr>
			</table>
		</s:form>
		</c:if>
	</body>
</html>

